<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
  String path = request.getContextPath();
%>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>再搜索用户重置密码</title>
<link href="<%=path%>/static/css/all.css?jejwej33we" rel="stylesheet" type="text/css">
<!--[if IE]>
<script>
(function(){if(!/*@cc_on!@*/0)return;var e = "abbr,article,aside,audio,canvas,datalist,details,dialog,eventsource,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,time,video".split(','),i=e.length;while(i--){document.createElement(e[i])}})()
</script>
<![endif]-->
</head>

<body>
<header>
<div id="topnav">
    <div class="topnav">
      <ul>
        <li><a href="<%=path%>/web/garbage/index" title="">首页</a></li>
        <li><a href="#" title="">关于我们</a></li>
        <li><a href="graphers.html" title="">开发团队</a></li>
      </ul>
      <ol>
        <li><a href="<%=path%>/web/userinfo/login">登录</a>/<a href="<%=path%>/web/userinfo/register">注册</a></li>
      </ol>
    </div>
  </div>
</header>
<section>
<div class="wrap">
    <div id="register">
      <div class="logo"><img src="<%=path%>/static/images/registerlogo.png" width="300" height="50" alt="分类搜索"></div>
      <div class="respont">
        <h1>找回密码</h1>
        <form id="resetPassword" action="<%=path%>/web/userinfo/sendCode" method="get">
          <ol>
            <li>
              <input name="username" id="username" type="text" aria-label="输入邮箱\手机号码" placeholder="输入邮箱\手机号码">
            </li>
            <%--<li>
              <input class="verifycode" name="input6" type="text">
              <img src="<%=path%>/static/images/img001.png">
              <span><a href="">更换</a></span>
            </li>--%>
            <li>
              <input class="submit" id="judge" type="button" value="下一步">
            </li>
          </ol>
        </form>
      </div>
    </div>
  </div>
</div>
</section>
<footer>
  <div id="footer">
    <div id="footernav"> <a href="#">返回顶部</a> <span>|</span> <a href="#">联系方式</a> <span>|</span> <a href="#">网站地图</a> <span>|</span> <a href="#">版权说明</a> </div>
    <div id="copyright">
      <p>copright qingsoft2013 web设计 <a href="HTTP://www.songshuo.com" target="_blank">宋硕设计网站设计工作室</a></p>
    </div>
  </div>
</footer>
</body>
<script src="<%=path%>/static/js/jquery-3.3.1.min.js"></script>
<script src="<%=path%>/static/js/layui/layui.all.js"></script>
<script>
  $(function () {
    $("#judge").click(function () {
      var username = $("#username").val();
      if(username.trim()==""){
        layer.msg("请输入手机号/邮箱",{icon: 5})
        return;
      }
      $.ajax({
        url: "<%=path%>/web/userinfo/findpassword",
        type:"post",
        data: {username: username},
        async: false,
        success: function (data) {
          if (data == "0") {
            layer.msg("请输入正确的邮箱或者手机号", {icon:5});
            return;
          }
          else {
            $("#resetPassword").submit();
          }}
      })
    })
  })
</script>
</html>
